package com.inmobi.androidsdk.impl.metric;

import android.content.Context;
import com.inmobi.androidsdk.bootstrapper.ConfigParams;
import com.inmobi.androidsdk.bootstrapper.Initializer;
import com.inmobi.androidsdk.bootstrapper.MetricConfigParams;

public class Logger
{
  private static String a = null;
  public static MetricAction action = null;
  private static Integer b = Integer.valueOf(2147483646);

  public static String getUrl()
  {
    return a;
  }

  public static void logEvent(Context paramContext, EventLog paramEventLog)
  {
    Storage.readNumberOfEventsAndTimeStampFromPersistent(paramContext);
    MetricConfigParams localMetricConfigParams = Initializer.getConfigParams(paramContext).getMetric();
    Queuer.queuer.log(paramEventLog);
    if (Queuer.queuer.number >= localMetricConfigParams.getDumpThreshhold())
      Storage.saveLocalCache(paramContext);
    if ((Storage.events >= localMetricConfigParams.getMaxInQueue()) || (Storage.timestamp + localMetricConfigParams.getNextRetryInterval() <= System.currentTimeMillis() / 1000L))
      new Thread(new a(paramContext)).start();
  }

  public static boolean startNewSample(Context paramContext)
  {
    synchronized (b)
    {
      b = Integer.valueOf(1 + b.intValue());
      if (b.intValue() >= Initializer.getConfigParams(paramContext).getMetric().getSamplingFactor())
      {
        b = Integer.valueOf(0);
        MetricAction localMetricAction = action;
        if (localMetricAction == null);
      }
    }
    try
    {
      action.metricCalcEvent();
      label68: return true;
      return false;
      localObject = finally;
      throw localObject;
    }
    catch (Exception localException)
    {
      break label68;
    }
  }

  static final class a
    implements Runnable
  {
    a(Context paramContext)
    {
    }

    public void run()
    {
      Storage.sendFile(this.a);
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.inmobi.androidsdk.impl.metric.Logger
 * JD-Core Version:    0.6.2
 */